<?php

use yii\db\Migration;

/**
 * Handles the creation of table `archive`.
 */
class m170320_075749_create_archive_table extends Migration
{
    /**
     * @inheritdoc
     */
    public function up()
    {
        $this->createTable('{{%archive}}', [
            'id' => $this->primaryKey()->comment('文档序号'),
            'arc_type' => $this->string(20)->comment('文档类型'),
            'title' => $this->string(200)->comment('标题'),
            'status' => $this->smallInteger(2)->defaultValue(0)->comment('状态'),
            'created_by'=>$this->integer(11)->notNull()->comment('创建人'),
            'created_at' => $this->integer(11)->notNull()->comment('创建时间'),
            'updated_by'=>$this->integer(11)->notNull()->comment('修改人'),
            'updated_at' => $this->integer(11)->notNull()->comment('修改时间'),
        ]);
    }

    /**
     * @inheritdoc
     */
    public function down()
    {
        $this->dropTable('{{%archive}}');
    }
}
